#include "Shm.hpp"
#include "Fifo.hpp"

int main()
{
    Shm shm(pathname, projid, CREATER);
    sleep(5);
    shm.Attr();

    NameFifo fifo(PATH, FILENAME);

    fileOper readerfile(PATH, FILENAME);
    readerfile.openForRead();

    char *mem = (char*)shm.VirtualAddr();

    while(true) {
        if (readerfile.Wait())
            println("{}", mem);
        else
            break;
    }

    readerfile.Close();
    return 0;
}
